package com.nut.lmsc.config;

import org.springframework.context.annotation.Configuration;

@Configuration
public class WxMpServiceConfiguration {

//    @Bean
//    public WxMpService wxMpService(MpProperties properties) {
//
//        DefaultApacheHttpClientBuilder httpClientBuilder = DefaultApacheHttpClientBuilder.get();
//        httpClientBuilder.setConnectionRequestTimeout(-1);//默认设置情况下多线程并发推送模板消息会有部分线程获取不到连接导致发送失败
//        httpClientBuilder.setMaxConnPerHost(50);
//        WxMpService service = new WxMpServiceHttpClientImpl();
//
//        WxMpDefaultConfigImpl configStorage = new WxMpDefaultConfigImpl();
//        configStorage.setAppId(properties.getAppId());
//        configStorage.setSecret(properties.getSecret());
////        configStorage.setToken(properties.getToken());
////        configStorage.setAesKey(properties.getAesKey());
//        configStorage.setApacheHttpClientBuilder(httpClientBuilder);
//
//        service.setWxMpConfigStorage(configStorage);
//
//        return service;
//    }
}
